import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import {createPinia} from "pinia";
import router from "./router";
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import Echarts from "vue-echarts"
import * as echarts from "echarts"


const pinia = createPinia()
//使用pinia持久化插件
pinia.use(piniaPluginPersistedstate)
const app = createApp(App)
//图表
app.component("v-chart", Echarts)
app.config.globalProperties.$echarts = echarts

//引入element plus
app.use(ElementPlus)
//引入pinia
app.use(pinia)
//引入路由
app.use(router);

//图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
